#! /bin/bash

# unpacks & installs automake to '$SYSCPAR_ROOT/tools/automake-1.6.3'
# requires:
#	$SYSCPAR_ROOT/downloads/automake-1.6.3.tar.gz
#
# type --help for usage

usage="$0 --help \t\t - shows this\n$0\t\t\t - installs automake-1.6.3\n$0 --clean\t\t - removes automake-1.6.3 installed by this script"

case $1 in '-h'|'-help'|'--help')
	echo  -e $usage
	exit;;
esac

[[ $1 == "--clean" ]] && { rm -rf $SYSCPAR_ROOT/tools/automake-1.6.3; echo 'cleaned'; exit 0; }

archive='automake-1.6.3.tar.gz'
cp $SYSCPAR_ROOT/downloads/$archive $SYSCPAR_ROOT/tools/
cd $SYSCPAR_ROOT/tools/
tar -xzf ./$archive
rm -f ./$archive
cd ./automake-1.6.3
./configure --prefix=$SYSCPAR_ROOT/tools/automake-1.6.3/
make clean all install

